'==================================================================================================
'	Author		David Segura
'	URL			http://winpeguy.com/
'	Source		http://winpe.codeplex.com/
'	Version		20130910
'==================================================================================================
'	Purpose:
'	Subroutines in the Start (Main) section should be included here
'==================================================================================================
'	File Locations in Windows:
'	%DeployRoot%\Boot\+WinPE\Menu\Scripts\Start.vbs
'==================================================================================================
'	File Location in WinPE:
'	X:\Menu\Scripts\Start.vbs
'==================================================================================================
'	Configuration:
'	None.  Editing this file is not recommended
'==================================================================================================
'	Change Log:
'	20130910	Codeplex Beta
'==================================================================================================
	Sub subCommandPrompt
		strRootDirectory = Left(strCurrentDirectory,3)
		objShell.CurrentDirectory = strRootDirectory
		objShell.Run "%ComSpec% /T:1F /K Title WinPE - Command Prompt", 1, False
		objShell.CurrentDirectory = strCurrentDirectory
	End Sub
'==================================================================================================
	Sub subReadme
		If objFSO.FileExists(strMenuDir & "\Readme.hta") Then
			sCmd = "mshta.exe " & strMenuDir & "\Readme.hta"
			objShell.Run sCmd
		End If
	End Sub
'==================================================================================================
	Sub subShutdown
		'sCmd = "wscript " & strScriptsDir & "\Shutdown.vbs"
		'objShell.Run sCmd
		
		If objFSO.FileExists(envSystem32 & "\wpeutil.exe") Then
			intAnswer = Msgbox("This computer will shut down and power off." & vbCrLf & "" & vbCrLf & _
			"Would you prefer to reboot instead?",36,MsgBoxTitleShort & "Shutdown or Reboot")
			If intAnswer = vbYes Then
				sCmd = "wpeutil.exe reboot"
			Else
				sCmd = "wpeutil.exe shutdown"
			End If
			'objShell.Run sCmd
			objShell.Run "cmd /c " & sCmd
		Else
			MsgBox "Cannot find " & envSystem32 & "\wpeutil.exe" & vbCrLf & "" & vbCrLf & _
			"This computer will be unable to shutdown from WinPE",16,MsgBoxTitleShort & "Shutdown or Reboot"
		End If
	End Sub
'==================================================================================================